package apIExercise.io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class ReadString {
    public static void main(String[] args) throws IOException {
        /*
        File file=new File("./afa.txt");
        FileInputStream fos=new FileInputStream(file);
        byte[] data=new byte[(int)file.length()];
        fos.read(data);
        String line=new String(data, StandardCharsets.UTF_8);
        System.out.println(line);
        fos.close();

         */
        File file=new File("afe.txt");
        FileInputStream fis=new FileInputStream(file);
        byte[] data=new byte[(int)file.length()];
        fis.read(data);
        String len=new String(data,StandardCharsets.UTF_8);
        System.out.println(len);
        fis.close();
    }
}
